#ifndef HELLOOPENGL_RENDER_H
#define HELLOOPENGL_RENDER_H
#include "geometry/geometries/Triangle.h"
#include "geometry/geometries/Cube.h"
#include "geometry/geometries/Axies.h"

#endif //HELLOOPENGL_RENDER_H

/**
 *  @param[in] pWwindow The window whose framebuffer was resized.
 *  @param[in] width The new width, in pixels, of the framebuffer.
 *  @param[in] height The new height, in pixels, of the framebuffer.
 */
void framebuff_size_callback(GLFWwindow *pWwindow, int width, int height);
/**
 * @param[in] pWwindow The window that received the event.
 *  @param[in] key The [keyboard key](@ref keys) that was pressed or released.
 *  @param[in] scancode The system-specific scancode of the key.
 *  @param[in] action `GLFW_PRESS`, `GLFW_RELEASE` or `GLFW_REPEAT`.
 *  @param[in] mods Bit field describing which [modifier keys](@ref mods) were
 */
void key_callback(GLFWwindow *pWwindow, int,int,int,int);


//GUI控制
static bool showDemoGUI = true;
static bool showMyGUI = true;

class Render {
private:
    /**window*/
    GLFWwindow* window;

    //渲染对象
    std::vector<Geometry *> rootGemetry;

    /**创建window*/
    void createWindow();

    /**初始化imGUI*/
    void initImGUI();

    /**渲染imGUI*/
    void renderImGUI(Geometry * geometry);

    /**
     * 输入处理
     * @param pWwindow window context
     */
    void processInputs();

    /**
     * 私有构造
     */
    Render();
public:

    /**
     * 获得实例
     * @return
     */
    static Render& getRenderInstance();

    /**
     * 标题
     */
    const char* windowTitle;

    /**
     * 窗口宽度
     */
    int windowWidth;

    /**
     * 窗口高度
     */
    int windowHeight;

    /**
     * 初始化
     */
     void init();

    /**
     * 渲染
     */
     void renderLoop();

     void render();

     /**
      * 回收
      */
     void terminate();

     /**
      * 创建所有待渲染的几何体
      */
     void renderLists();
};



